package com.xinqi.modules.prepare.courseware.client;

import com.xinqi.common.base.constants.ServiceNameConstants;
import com.xinqi.common.base.response.PageInfo;
import com.xinqi.common.base.response.R;
import com.xinqi.modules.prepare.courseware.dto.req.PrepareCoursewarePartCreateDTO;
import com.xinqi.modules.prepare.courseware.dto.req.PrepareCoursewarePartQueryDTO;
import com.xinqi.modules.prepare.courseware.dto.req.PrepareCoursewarePartUpdateDTO;
import com.xinqi.modules.prepare.courseware.dto.rsp.PrepareCoursewarePartResultDTO;
import com.xinqi.modules.prepare.courseware.factory.PrepareCoursewarePartFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 备课区互动课件切片客户端
 *
 * @author: system
 * @date: 2023/03/19
 */
@FeignClient(value = ServiceNameConstants.XQ_PREPARE, fallbackFactory = PrepareCoursewarePartFallbackFactory.class)
public interface PrepareCoursewarePartClient {

    /**
     * 备课区互动课件切片-分页
     */
    @GetMapping("/prepare-courseware-part/page")
    R<PageInfo<PrepareCoursewarePartResultDTO>> page(PrepareCoursewarePartQueryDTO dto);

    /**
     * 备课区互动课件切片-详情
     */
    @GetMapping("/prepare-courseware-part/{id}")
    R<PrepareCoursewarePartResultDTO> findById(@PathVariable("id") Long id);

    /**
     * 新增备课区互动课件切片
     */
    @PostMapping("/prepare-courseware-part")
    R<Long> insert(@RequestBody PrepareCoursewarePartCreateDTO dto);

    /**
     * 修改备课区互动课件切片
     */
    @PutMapping("/prepare-courseware-part/{id}")
    public R<Boolean> update(@PathVariable("id") Long id, @RequestBody PrepareCoursewarePartUpdateDTO dto);

    /**
     * 删除备课区互动课件切片
     */
    @DeleteMapping("/prepare-courseware-part/{id}")
    R<Boolean> delete(@PathVariable("id") Long id);

}
